<template>
  <div class="wage-set-wrapper p24 page-miH page-bgBack">
    <a-tabs v-model="tabs" @change="tabsChange">
      <a-tab-pane key="0" tab="薪资组">
        <group />
      </a-tab-pane>
      <a-tab-pane key="1" tab="计税规则">
        <rule />
      </a-tab-pane>
    </a-tabs>
  </div>
</template>
<script>
export default {
  components: {
    group: () => import("@/views/wages/set/group"),
    rule: () => import("@/views/wages/set/rule")
  },

  data() {
    return {
      tabs: "0"
    };
  },

  created() {
    this.tabs = this.$route.query.tabs ? this.$route.query.tabs : "0";
  },
  methods: {
    tabsChange(e) {
      const query = JSON.parse(JSON.stringify(this.$router.history.current.query)); // 取当前路由query值并且深拷贝
      const path = this.$router.history.current.path; // 取当前路由地址
      query.tabs = e; // 修改变动的query值
      this.$router.push({ path, query }); // 改变query值
    }
  }
};
</script>
<style lang="scss" scoped>
.wage-set-wrapper {
  .ant-menu-vertical {
    min-height: 90%;
  }
}
</style>
